<?php
namespace app\admin\controller;
use think\Controller;
use think\Db;
class Login extends Controller{
	public function index(){
		$house = getHouseList();
		$this->assign('houseList',$house);
		return $this->fetch('index');
	}
	public function login(){
		$userName = input('userName');
		$userPwd = input('userPwd');
		$rs = checkUserLogin($userName,$userPwd);
		if($rs['status'] < 0){
			return $rs;
			exit;
		}
		if($rs['data']['isManager'] != 1){
			$data['status'] = 0;
			$data['msg'] = '权限不足，无法访问该网页';
			$data['data'] = "";
			return $data;
		}
		session('ADMIN_USERS',$rs['data']);
		$data['status'] = 1;
		$data['msg'] = 'ok';
		$data['data'] = $rs['data'];
		return $data;
	}
}
?>